<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRegionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('regions', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->nullable()->comment('名称');
            $table->integer('parent_id')->default(0)->comment('上级id');
            $table->string('sketch')->nullable()->comment('简述');
            $table->boolean('type')->default(0)->comment('层级');
            $table->string('cityCode')->nullable()->comment('城市代码');
            $table->string('zipCode')->nullable()->comment('邮政编码');
            $table->string('merger')->nullable()->comment('合并');
            $table->string('lng')->nullable()->comment('经度');
            $table->string('lat')->nullable()->comment('纬度');
            $table->string('pinYin')->nullable()->comment('拼音');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('regions');
    }
}
